<template>
    <div>
        <el-table
                :data="tableData"
                size="small"
                stripe
                border
                style="width: 100%; margin-top: 10px;">
            <el-table-column
                    prop="verison"
                    label="版本号">
            </el-table-column>
            <el-table-column
                    prop="notice"
                    label="更新提示语">
            </el-table-column>
            <el-table-column
                    prop="type"
                    :formatter="typeFormatter"
                    label="更新方式">
            </el-table-column>
            <el-table-column
                    prop="system"
                    label="操作系统">
            </el-table-column>
            <el-table-column
                    prop="updateTime"
                    label="更新时间">
            </el-table-column>
            <el-table-column
                    label="操作">
                <template v-slot="scope">
                    <el-button type="text" size="small" @click="viewDetail">查看</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>

  import { UPDATE_KV } from '@/utils/constant'

  export default {
    name: 'tableList',
    props: {
      tableData: Array
    },
    data() {
      return {
      }
    },
    methods: {
      viewDetail(row) {
        this.$router.push({
          path: '/systemManage/detail',
          query: {
            id: row.id
          }
        })
      },
      typeFormatter (row) {
        return UPDATE_KV[row.type] || '-'
      }
    }
  }
</script>

<style scoped>

</style>
